home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!DOCTYPE xsl:stylesheet [
-
- <!ATTLIST thesis:opt id ID #REQUIRED>
- ]>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:thesis="http://www.silmaril.ie/thesis"
- exclude-result-prefixes="xsl thesis">
- <xsl:output method="text"/>
-
- <thesis:opts>
- <thesis:opt id="foo" />
- <thesis:opt id="bar" />
- </thesis:opts>
-
- <xsl:output indent="yes"/>
- <xsl:template match="thesis">
- <xsl:text>Options: </xsl:text>
- <xsl:variable name="options" select="@options" />
- <!-- change the context to the stylesheet document -->
- <xsl:for-each select="document('')/*">
- <!-- get the id attributes of any options identified by ID -->
- <xsl:for-each select="id($options)/@id">
- <xsl:value-of select="." />
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
- </xsl:stylesheet>
-